/**
 * 网络模块接口文件
 */
import {request} from "./care";
import API from "./url";

const CLIENT = {
    // 注入全局
    install(Vue){
        Vue.prototype.$CLIENT = this;
      },
    /**
     * 商品列表
     */
    getList(){return request(API.METHOD.GET,API.PATH.GETLIST)},
    /**
     * 砍价列表
     */
    getBarg(){return request(API.METHOD.GET,API.PATH.GETBARG)},
    /**
     * 精选专题
     * @param {*} id 
     */
    getSpecial(id){return request(API.METHOD.GET,API.PATH.SWIPERISCROLL,id)},
    /**
     * 人气推荐POPULAR
     * @param {*} id 
     */
    getPopular(id){return request(API.METHOD.GET,API.PATH.POPULAR,id)},
    /**
     * 砍价 商品详情
     * @param {*} id 
     */
    getBargDetail(id){return request(API.METHOD.GET,API.PATH.GETBARGDETAIL,id)},
    /**
     * 专栏详情
     * @param {*} id 
     */
    seletedDetail(id){return request(API.METHOD.GET,API.PATH.SELECTEDINFO,id)},
    /**
     * 商品分类
     */
    getClassify(){return request(API.METHOD.GET,API.PATH.CLASSIFY)},
    /**
     * 用户登录
     * @param {*} temp 
     */
    setLogin(params){return request(API.METHOD.GET,API.PATH.LOGIN,params)}}

export default CLIENT;